#pragma once
#include "Local References.h"
#include "../World Definitions.h"

#include <fstream>
#include <sstream>
#include <string>
class Entity;
using namespace std;
//**************************************************************************/
//This is the file for the Ethnis stat sheet, which is used by all entities
//It contains an Enum and the structure that will allow access and modification
// - Tyler Lawton 10/24/2011
//**************************************************************************/

struct Statsheet
{

	short Stats[STAT_NUMOFSTATS]; //THE STAT SHEET OMG ETHNIS!
	short Bonuses[7];

	Statsheet();
	~Statsheet();					//Deconstructer!
	 
	void LoadStats(char* s_Statesheet, short &p_race);
	void SaveStats(Statsheet p_Stats,  char* s_Statsheet, short race);
	bool UpdateStats();				//When you level up, consume a potion, or change your active items; this is called to change your stats
	
	//These functions have the purpose of caluating the individual aspects
	//These aspects are to be given to the entity who owns this individual statsheet
	//a_P = Pierce, a_I = Impact, a_E = Energy
	void CalcPrimarySkills();
	void CalcQualities();
	short CalcMaxMeta			();
	float CalcMetaRegen			()
	{
		return float(Stats[STAT_MTP])/10;
	}
	void CalcAttSpeed			(short& a_AttSpeed, short skill);
	void CalcPull				(short& a_Pull);
	void CalcLoads				(short& a_ML,short& a_LL);
	void CalcThresholds			(short& a_P, short& a_I, short& a_E);
	void CalcNaturalResistances	(short& a_P, short& a_I, short& a_E);
	void CalcSpeedAttributes	(double& a_Acceleration, double& a_MaxSpeed);


	float calcJumpImpulse()
	{
		float base = float(BLOCK_TEXTURE_SIZE * 0.5f);
		base += (float)(Stats[STAT_VAULT]*0.09); //One additional block per 10 skill points
		return base;
	}
};

#include "Entity.h"
